package com.nbsaas.boot.controller.web;

import org.springframework.beans.factory.config.ConfigurableBeanFactory;
import org.springframework.context.annotation.Scope;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import jakarta.annotation.PostConstruct;
import jakarta.annotation.PreDestroy;

@Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
@RestController
public class StateController {

    private Integer account=0;

    @RequestMapping("/state")
    public String state(){
        account++;
        return "ok";
    }

    @RequestMapping("/account")
    public String account(){
        return "account:"+account;
    }


    @PostConstruct
    public void init(){
       System.out.println("init");
    }


}
